package JSE_01.Calendar.demo01;

import java.util.Calendar;

public class Demo01Calendar {
    public static void main(String[] args){
        Calendar cal=Calendar.getInstance();
        //System.out.println(cal);


        System.out.println(cal.getTime());

        cal.set(Calendar.YEAR,2017);
        cal.set(Calendar.MONTH,10);
        cal.set(Calendar.DAY_OF_MONTH,11);

        cal.add(Calendar.YEAR,3);
        cal.add(Calendar.MONTH,-3);
        cal.add(Calendar.DAY_OF_MONTH,3);


        System.out.println(cal.get(Calendar.YEAR));
        System.out.println(cal.get(Calendar.MONTH));
        System.out.println(cal.get(Calendar.DAY_OF_MONTH));
        System.out.println(cal.get(Calendar.HOUR));
        System.out.println(cal.get(Calendar.MINUTE));
        System.out.println(cal.get(Calendar.SECOND));
    }
}
